-- Viral Resistance - T-Engine 4 Module
-- Copyright (C) 2010 Mikolai Fajer
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program.  If not, see <http://www.gnu.org/licenses/>.
--
-- Mikolai Fajer "yufra"
-- mfajer@gmail.com

local Object = require "mod.class.Object"

-- Add the elevator button
local elevator_button = Object.new{
	name="Elevator Button",
	desc=[[A panel of buttons.]],
	display='x', color=colors.SLATE,
	can_talk = "elevator",
	show_tooltip=true,
	type = "button", subtype="button",
}

-- Add the elevator button
local phone = Object.new{
	name="Emergency phone",
	desc=[[A red phone.]],
	display='x', color_r=100, color_g=0, color_b=0,
	can_talk = "emergency_phone",
	show_tooltip=true,
	type = "phone", subtype="phone",
}

-- Add signs
local newSign = function(tooltip)
	return Object.new{show_tooltip=true, tooltip=tooltip, name='sign', display='?', color=colors.GREY}
end

-- defineTile section
defineTile("#", "WALL")
defineTile("E", "ELEVATOR_DOOR")
defineTile("o", "WINDOWED_DOOR")
defineTile("+", "WOODEN_DOOR")
defineTile("=", "DESK")
defineTile("p", "DESK", phone)
defineTile(">", "DOWN")
defineTile(".", "FLOOR")
defineTile(" ", "WINDOW")
defineTile("e", "WALL", elevator_button)

-- addSpot section
addSpot({31, 1}, "stairs", "a")
addSpot({33, 1}, "stairs", "b")
addSpot({64, 1}, "stairs", "c")
addSpot({66, 1}, "stairs", "d")
addSpot({31, 37}, "stairs", "e")
addSpot({33, 37}, "stairs", "f")
addSpot({66, 37}, "stairs", "h")
addSpot({64, 37}, "stairs", "g")

-- ASCII map section
return [[
##################################################################################################
#....#....#....#....#....#....#.#>##############################.#>#....#....#....#....#....#....#
#....#....#....#....#....#....#.#.##############################.#.#....#....#....#....#....#....#
#....#....#....#....#....#....#...##############################...#....#....#....#....#....#....#
#....#....#....#....#....#....#...##############################...#....#....#....#....#....#....#
###o###o#####o###o#####o###o####o################################o####o###o#####o###o#####o###o###
#.............................#....................................#.............................#
#.............................#....................................#.............................#
#....=====.=====.======.......#....................................#.......=.....................#
#....=................=.......o...##############################...o.......=.....................#
#....=................=.......o...##############################...o.......=.....................#
#....=====.=====.======.......#...##############################...#.......=.....................#
#.............................#...##############################...#.............................#
#.............................#...##############################...#.............................#
###o###o#####o###o#####o###o###...##############################...###o###o#####o###o#####o###o###
#....#....#....#....#....#....#...###########...#...############...#....#....#....#....#....#....#
#....#....#....#....#....#....#...###########...e...############...#....#....#....#....#....#....#
#....#....#....#....#....#....#...############E###E#############...#....#....#....#....#....#....#
#....#....#....#....#....#....#....................................#....#....#....#....#....#....#
###############################....................................###############################
#....#....#....#....#....#....#....................................#....#....#....#....#....#....#
#....#....#....#....#....#....#...############E###E#############...#....#....#....#....#....#....#
#....#....#....#....#....#....#...###########...e...############...#....#....#....#....#....#....#
#....#....#....#....#....#....#...###########...#...############...#....#....#....#....#....#....#
###o###o#####o###o####o####o###...##############################...###o###o#####o###o#####o###o###
#.............................#...##############################...#.............................#
#.............................#...##############################...#.............................#
#....=====.=====.======.......#...##############################...#.......=.....................#
#....=................=.......o...##############################...o.......=.....................#
#....=................=.......o...##############################...o.......=.....................#
#....=====.=====.======.......#....................................#.......=.....................#
#.............................#....................................#.............................#
#.............................#....................................#.............................#
###o###o#####o###o####o####o####o####+####+#################+####o####o###o#####o###o#####o###o###
#....#....#....#....#....#....#...#.....#...#.......=...p#.....#...#....#....#....#....#....#....#
#....#....#....#....#....#....#...#.....#...+.......=....#.....#...#....#....#....#....#....#....#
#....#....#....#....#....#....#.#.#.....#==.#.......==...#.....#.#.#....#....#....#....#....#....#
#....#....#....#....#....#....#.#>#.....#...#............#.....#.#>#....#....#....#....#....#....#
####################################   #######  #    #  ###   ####################################]]